
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <title>解绑页面 - 悠学派</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="css/util.css">
    <link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
    <div class="limiter">
        <div class="container-login100">
            <div class="wrap-login100">
                <div class="login100-form-title" style="background-image: url(img/bg-01.jpg);">
                    <span class="login100-form-title-1">解 绑</span>
                </div>

                <form class="login100-form validate-form">
                    <div class="wrap-input100 validate-input m-b-26" data-validate="用户名不能为空">
                        <span class="label-input100">用户名</span>
                        <input class="input100" type="text" name="username" id="studentNo" placeholder="请输入用户名">
                        <span class="focus-input100"></span>
                    </div>

                    <div class="wrap-input100 validate-input m-b-18" data-validate="密码不能为空">
                        <span class="label-input100">密码</span>
                        <input class="input100" type="password" name="password" id="password" placeholder="请输入密码">
                        <span class="focus-input100"></span>
                    </div>

<!--                    <div class="flex-sb-m w-full p-b-30">
                        <div class="contact100-form-checkbox">
                            <input class="input-checkbox100" id="ckb1" type="checkbox" name="remember-me">
                            <label class="label-checkbox100" for="ckb1">记住我</label>
                        </div>

                        <div>
                            <a href="javascript:" class="txt1">忘记密码？</a>
                        </div>
                    </div> -->

                    <div class="container-login100-form-btn">
                        <button class="login100-form-btn" id="unBind">解 绑</button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <script src="js/jquery-3.2.1.min.js"></script>
	<script src="js/layer.js"></script>
    <script src="js/main.js"></script>
	<script>
	    $(function(){
	        $('#unBind').on('click', function(){
				event.preventDefault();
				var ii = layer.load(0, {shade: false});
				var studentNo = document.getElementById("studentNo").value;
				var password = document.getElementById("password").value;
	            $.ajax({
	                cache: false,
	                type: "POST",
	                url:"http://wisdom.aaalei.cn:8088/bindDevice/unbind",
					contentType:'application/json;charset=UTF-8',
	                data:JSON.stringify({"studentNo":studentNo,"password":password}),
	                async: true,
	                success: function(data) {
						console.log(data);
						console.log(data.code);
						layer.close(ii);
	                    if(data.code == '200'){
							layer.msg(data.name + ',解绑成功!', {
							  icon: 1,
							  time: 2000 //2秒关闭（如果不配置，默认是3秒）
							}, function(){
							  $('.input100').val("");
							});
	                    }else{
	                        layer.msg(data.msg + ',解绑失败!', {
	                          icon: 2,
	                          time: 2000 //2秒关闭（如果不配置，默认是3秒）
	                        }, function(){
	                          $('.input100').val("");
	                        });
	                    }
	                },
	            });
	        });
	    })
	 
	</script>
</body>

</html>